using System;
using UnityEditor;
using UnityEngine;
using Yoozoo.Gameplay.City;

namespace Yoozoo.Gameplay.CityEditor
{
    [CustomEditor(typeof(CityUnlockAreaEditor))]
    public class CityUnlockAreaEditorEditor : UnityEditor.Editor
    {

        private CityUnlockAreaEditor _cityUnlockAreaEditor;
        
        private void OnEnable()
        {
            _cityUnlockAreaEditor = target as CityUnlockAreaEditor;
        }

        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("开始编辑",GUILayout.Height(30f)))
            {
                _cityUnlockAreaEditor.Begin();
            }

            if (GUILayout.Button("结束编辑",GUILayout.Height(30f)))
            {
                _cityUnlockAreaEditor.End();
            }
            GUILayout.EndHorizontal();
        }
    }
}